<%@page import="com.java.model.MusicInfo"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.java.bean.MusicBean"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<link rel="icon" href="./icon/ico.ico">
<link href="./css/bootstrap.min.css" rel="stylesheet">
<%
	ArrayList<MusicInfo> list = new ArrayList<MusicInfo>();
	String tag = "1";
	if (request.getParameter("tag") != null) {
		tag = (String) request.getParameter("tag");
		System.out.println(tag);
	}
	if (tag.equals("1")) {
		MusicBean musicBean = new MusicBean();

		list = musicBean.getList("download", "0", "10");
	} else {
		MusicBean musicBean = new MusicBean();
		list = musicBean.getList("play", "0", "10");
	}
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>排行榜</title>
</head>
<body>
	<div id="container">
		<div id="header" style="text-align: center;">
			<label><button type="button" class="btn btn-primary">
					<a href="top.jsp?tag=1" style="color: #ffffff">最热下载</a>
				</button> </label> <label>
				<button type="button" class="btn btn-primary">
					<a href="top.jsp?tag=2" style="color: #ffffff">最热播放</a>
				</button>
			</label>
		</div>
	</div>
	<span>
		<table class="table table-hover" border="0sp" width="100%">
			<tr align="center">
				<th colspan="1" rowspan="1" headers="" scope="col" width="10%">
					ID</th>
				<th colspan="1" rowspan="1" headers="" scope="col" width="30%">
					名字</th>
				<th colspan="1" rowspan="1" headers="" scope="col" width="30%">
					演唱者</th>
				<th colspan="1" rowspan="1" headers="" scope="col" width="10%">
					下载次数</th>
				<th colspan="1" rowspan="1" headers="" scope="col" width="10%">
					播放次数</th>
				<th colspan="1" rowspan="1" headers="" scope="col" width="5%">
					播放</th>
				<th colspan="1" rowspan="1" headers="" scope="col" width="5%">
					下载</th>
			</tr>
			<%
				for (int i = 0; i < list.size(); i++) {
			%>
			<tr align="center">
				<th colspan="1" rowspan="1" headers="" scope="col" width="10%">
					<%=(i + 1)%></th>
				<th colspan="1" rowspan="1" headers="" scope="col" width="30%">
					<%=(list.get(i).getName())%></th>
				<th colspan="1" rowspan="1" headers="" scope="col" width="30%">
					<%=list.get(i).getPlayer()%></th>
				<th colspan="1" rowspan="1" headers="" scope="col" width="10%">
					<%=list.get(i).getDownload()%></th>
				<th colspan="1" rowspan="1" headers="" scope="col" width="10%">
					<%=list.get(i).getPlay()%></th>
				<th colspan="1" rowspan="1" headers="" scope="col" width="5%"><a
					href="play.jsp?id=<%=list.get(i).getId()%>"><img alt="text"
						src="./icon/play.ico" width="30sp" height="30sp"> </a></th>
				<th colspan="1" rowspan="1" headers="" scope="col" width="5%"><a
					href="download.jsp?id=<%=list.get(i).getId()%>"> <img
						alt="text" src="./icon/download.ico" width="30sp" height="30sp">
				</a></th>
			</tr>
			<%
				}
			%>
		</table>
	</span>
</body>
</html>